﻿using System.Text.RegularExpressions;
using Duo1JHttpServer.Framework.Enum;
using Duo1JHttpServer.Framework.Interface;

namespace Duo1JHttpServer.Framework.Model
{
    /// <summary>
    /// 配置文件解析器模型
    /// </summary>
    public class AnalyzerModel
    {
        /// <summary>
        /// 路径匹配
        /// </summary>
        public Regex PathRegex { get; private set; }

        /// <summary>
        /// 配置类型
        /// </summary>
        public ConfigType Type { get; private set; }

        /// <summary>
        /// 配置解析器
        /// </summary>
        public IConfigAnalyzer Analyzer { get; private set; }

        public AnalyzerModel(ConfigType type, Regex pathRegex, IConfigAnalyzer analyzer)
        {
            Type = type;
            PathRegex = pathRegex;
            Analyzer = analyzer;
        }
    }
}